/**
 * 对uni.request做二次封装
 */

class RequestHttp {
	constructor(){
		
	}
	
	get<T>(url:string,params: object = {}): Promise<T>{
		return uni.request({
			//@ts-ignore
			url:import.meta.env.VITE_API_BASE_URL + url,
			method:'GET',
			data:params
		}).then(({data})=>{
			//直接讲 接口返回值，给resolve
			return (data as unknown as T)
		})
	}
	
	post(){
		
	}
}

export default new RequestHttp()